package window.imp;

import DTO.ExcelDataDTO;
import window.TopFrame;

import javax.swing.*;
import java.awt.*;

/**
 * @description: 置顶的信息窗口
 * @author: ziger
 * @time: 2022/8/26 21:17
 */
public class DefaultTopFrame extends TopFrame {

    JTextField  tRow  = new JTextField("待选择",25);
    JTextField tColum = new JTextField("待选择",25);
    JTextField tText = new JTextField("待选择",25);

    public DefaultTopFrame(){
        setTitle("复制内容查看器");
        setAlwaysOnTop(true);
        setSize(500,150);
        setResizable(false);

        JLabel row = new JLabel("行项目");
        JLabel colum = new JLabel("列项目");
        JLabel text = new JLabel("内    容");

        Container contentPane = getContentPane();

        JPanel jp = new JPanel();
        jp.setLayout(new GridLayout(3,1));

        JPanel jpc = new JPanel();
        jpc.add(colum);
        jpc.add(tColum);

        JPanel jpr = new JPanel();
        jpr.add(row);
        jpr.add(tRow);

        JPanel jpMain = new JPanel();
        jpMain.add(text);
        jpMain.add(tText);

        jp.add(jpc);
        jp.add(jpr);
        jp.add(jpMain);

        contentPane.add(jp);

        setVisible(true);
    }

    public void showInfo(ExcelDataDTO data){
        tRow.setText(data.getRow());
        tColum.setText(data.getColum());
        tText.setText(data.getText());
    }

    public void endInfo(){
        tRow.setText("读取完毕");
        tColum.setText("读取完毕");
    }


}
